<% #endcoding:utf-8%>
<div class="panel">
  <div class="panel-heading">
    <%=render partial: "messages/nav"%>
  </div>
  <%if !@messages.any? %>
      <%=render partial: "shared/no_content"%>
  <%else%>
      <%=render @messages%>
      <%=will_paginate @messages%>
  <%end%>
  <div class="panel-footer"></div>
</div>

<script>
    function readit(mid,obj){
        $.ajax({
            url:"<%=messages_update_url%>",
            dataTyp:'json',
            method:'put',
            data:{message:{id:mid}},
            success:function(re) {
                if (re.stat == 1) {
                    document.location.href = $(obj).find("span").attr('url');
                }
            }
        });
    }
</script>